<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC 	"-//W3C//DTD XHTML 1.0 Transitional//EN"
						"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html 	xmlns="http://www.w3.org/1999/xhtml"
		xmlns:h="http://java.sun.com/jsf/html"
		xmlns:f="http://java.sun.com/jsf/core">
	<f:view locale="#{facesContext.externalContext.request.locale}">
	<f:loadBundle basename="texte.Info" var="vhtexte" />
	<h:head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<link rel="stylesheet" type="text/css" href="#{resource['css:dokument.css']}" />
		<title><h:outputText value="#{vhtexte.addTournamentTitel}"/></title>
	</h:head>
	<h:body>
	<h:outputStylesheet name="fonts.css"/>
	
		<h:outputText value='Not an admin' style='error' rendered="#{!addTournamentBean.admin}"/>
		<h:form id="error" rendered="#{addTournamentBean.admin}">
			<h2><h:outputText value="#{vhtexte.addTournament}" styleClass='headline'/></h2>
			<p>
			<h:panelGrid columns="3" border="0" cellpadding="2">
				<h:panelGroup>
					<b><h:outputText value="#{vhtexte.name}" styleClass='legal'/></b>
				</h:panelGroup>
				<h:panelGroup>
					<h:inputText id="turniername" maxlength="15" size="21"
						value="#{addTournamentBean.name}"
						required = "true">
						<f:validateLength 
							 minimum="3" maximum="20"/>
					</h:inputText>
				</h:panelGroup>
				<h:panelGroup>
					<h:message for="turniername" style="color: red"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<b><h:outputText value="#{vhtexte.startTime}" styleClass='legal'/></b>
				</h:panelGroup>
				<h:panelGroup>
					<h:inputText id="starttime" maxlength="21" size="21"
						value="#{addTournamentBean.starttime}"
						required = "true">
						<f:convertDateTime type="BOTH" pattern="dd.MM.yyyy - HH:mm:ss" />
					</h:inputText>
				</h:panelGroup>
				<h:panelGroup>
					<h:message for="starttime" style="color: red"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<b><h:outputText value="#{vhtexte.maxPlayer}" styleClass='legal'/></b>
				</h:panelGroup>
				<h:panelGroup>
					<h:inputText id="maxPlayer" maxlength="3" size="21"
						value="#{addTournamentBean.maxPlayer}"
						required = "true">
						<f:validateLongRange 
	                         minimum="4"/>
					</h:inputText> 
				</h:panelGroup>
				<h:panelGroup>
					<h:message for="maxPlayer" style="color: red"/>
				</h:panelGroup>
				
				<h:panelGroup>
					<b><h:outputText value="#{vhtexte.addGame}" styleClass='legal'/></b> 
				</h:panelGroup>
				<h:panelGroup>
					<h:selectOneMenu id="selectGame" 
						value="#{addTournamentBean.currentGame}"> 
						<f:selectItems value="#{addTournamentBean.gameList}" />
					</h:selectOneMenu> 
				</h:panelGroup>
				<h:panelGroup>
					<h:message for="tourneyID" style="color: red"/>
				</h:panelGroup>	
			</h:panelGrid>
			
			<p>
			<br />
			<h:outputText value="#{vhtexte.pflicht}"/> <br />
			<p>
			<h:commandButton 	styleClass="senden"
								action="#{addTournamentBean.addTournament}"
								value="#{vhtexte.addTournamentBtn}" />
			<br />
			<br />
			<!-- Zurueck zur Uebersicht -->
			- <h:outputLink value="tourneys.xhtml">
				<h:outputText value="#{vhtexte.backToOverview}"/>
			</h:outputLink>
			</p>
			</p>
			</p>
		</h:form>
	</h:body>
	</f:view>
</html>